class c_screener_mode:
	def music_check(self):
		preseted=self.getPresetMusic()
		if (not preseted is None) and preseted!=self.gears.music:
			self.gears.music=preseted
			import pygame
			if len(self.gears.music)==1:
				pygame.mixer.music.load(preseted[0])
				pygame.mixer.music.set_volume(self.gears.music_volume)
				pygame.mixer.music.play(loops=-1)
			else:
				import random
				preseted1=preseted[:]
				mus=random.choice(preseted1)
				preseted1.remove(mus)
				pygame.mixer.music.load(mus)
				pygame.mixer.music.set_volume(self.gears.music_volume)
				pygame.mixer.music.play(loops=0)
				
				while len(preseted1)>0:
					mus=random.choice(preseted1)
					preseted1.remove(mus)
					pygame.mixer.music.queue(mus)
	def activate(self):
		pass
	def getPresetMusic(self):
		return self.music
	def switch_mode(self,menu1):
		#global current_submenu
		current_submenu=self.gears.screenStack
		if (menu1 is None):
			current_submenu.pop(-1)
			if len(current_submenu)>0:
				current_submenu[-1].set_gears(self.gears)
		elif (current_submenu.count(menu1)>0):
			self.gears.screenStack=current_submenu[0:current_submenu.index(menu1)+1]
			menu1.set_gears(self.gears)
		else:
			self.gears.screenStack.append(menu1)
			menu1.set_gears(self.gears)#self.share_globals(menu1)
			menu1.activate()
		
	def set_gears(self,gears):
		self.gears=gears#None
		self.locali_check()
		self.window_check()
		self.music_check()
	def share_gears(self,another):
		pass#another.set_gears(self.gears)
	def do(self):
		pass
	def excludeSelf(self):
		current_submenu=self.gears.screenStack
		i=current_submenu.index(self)
		current_submenu.pop(i)
	def locali_check(self):
		pass
	def window_check(self):
		if self.window_size!=self.gears.screen_size:
			self.configure_window()
		#pass
	def configure_window(self):
		pass
	def __init__(self):
		self.window_size=(0,0)
		self.file=''
		self.locali=''
		self.gears=None
		self.music=None